package org.example;

import org.example.dao.BookDao;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;


/**
 * Hello world!
 */
public class App 
{
    public static void main( String[] args )
    {
//        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml.bark");
//        BookDao bookDao = ctx.getBean("bookDao", BookDao.class);
//        bookDao.save();
        Resource resources = new ClassPathResource("applicationContext.xml.bark");
        BeanFactory bf = new XmlBeanFactory(resources);
        BookDao bookDao = bf.getBean(BookDao.class);
        bookDao.save();
    }
}
